<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Nova Locação</title>
    </h:head>

    <h:body>

        <ui:composition template="./templates/TemplatePagina.xhtml">

            <ui:define name="barraTitulo">
               
            </ui:define>
            
            <ui:define name="barraMenu">
               
            </ui:define>

            <ui:define name="conteudo">
                <h:form>


                    <p:panel header="Filmes ">


                        <p:dataTable value="#{filmeController.itens}" var="item"  widgetVar="filmesTable"
                                     emptyMessage="Nenhum item encontrado" >
                            <p:column headerText="Código">
                                <h:outputText value="#{item.id}"/>
                            </p:column>
                            <p:column headerText="Titulo" filterBy="#{item.nome}">
                                <h:outputText value="#{item.nome}"/>
                            </p:column>
                            <p:column headerText="Descricao">
                                <h:outputText value="#{item.descricao}"/>
                            </p:column>
                            <p:column  headerText="Ator Principal" filterBy="#{item.ator}">
                                <h:outputText value="#{item.ator}"/>
                            </p:column>

                            <p:column headerText="Ano de Lancamento">
                                <h:outputText value="#{item.anoLancamento}"/>
                            </p:column>

                            <p:column headerText="&nbsp;">
                                <h:commandLink action="#{filmeController.adionarFilme}" value="Selecionar">
                                </h:commandLink>
                            </p:column>

                        </p:dataTable>

                    </p:panel>
                </h:form>
            </ui:define>

            <ui:define name="rodape">
                bottom
            </ui:define>

        </ui:composition>

    </h:body>
</html>
